{extend name="/fool" /}
{block name="css"}
<link rel="stylesheet" href="/css/admin/product_list.css">
<style>
    .layui-form-onswitch{
        /*background: #1989FA;*/
        /*border-color: #1989FA;*/
    }
    .layui-upload-img{
        height:200px;
        width:200px;
        margin: 10px;
    }
    .value{
        text-align: left;
    }
    .dt{
        width:200px;
        height:200px;
    }
    #xssj{
    	margin:10px 0;
    	padding:10px;
    	border:1px solid #000;
    }
</style>
{/block}
{block name="menu_content"}
<form class="layui-form" action="" method="post" enctype="multipart/form-data">
    <ul id="content">
        <li class="li">
            <table class="one">
                <tr>
                    <td class="one-one">服务中心名称：</td>
                    <td class="value">
                        <div class="layui-input-inline">
                            <input type="text" name="name" value="{$list.name}" autocomplete="off" class="layui-input" placeholder="输入商品名称">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">下属商家：</td>
                    <td class="value">
                        <div>
		                    搜索商家账号：
		                    <div class="layui-input-inline">
		                        <input type="text" name="batterybaid" autocomplete="off" id="jtnum" class="layui-input" placeholder="商家账号">
		                    </div>
		                    <button type="button" class="layui-btn ss">搜索</button>
		                    <div class="layui-input-inline" id="ss">
		                        <input type="text" name="batterybaid" autocomplete="off" class="layui-input" disabled style="background:#e7e7e7;">
		                    </div>
		                    <button type="button" class="layui-btn" id="fp">分配到服务中心</button>
		                </div>
                        <div id="xssj">
                             {$userall}
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">是否运营：</td>
                    <td class="value">
                        <div style="margin-left:0;" class="layui-input-block">
                            <input type="radio" name="status" value="1" title="是">
                            <input type="radio" name="status" value="2" title="否">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="one-one">
                        <button type="button" class="listbu layui-btn">取消</button>
                    </td>
                    <td class="value">
                        <button type="submit" class="fh layui-btn">保存</button>
                    </td>
                </tr>
            </table>
        </li>
    </ul>
</form>
<!-- 配置文件 -->
<script type="text/javascript" src="/utf8-php/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/utf8-php/ueditor.all.js"></script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container',{
        initialFrameHeight: 300,
        initialFrameWidth: 500
    });
</script>
<script>
	$("#fp").click(function(){
        var val = $("#ss").find('input').val();
        var sid = $("#ss").find('input').attr('sid');
        if(val.length>0){
            $.post("{:url('upfp')}",{'id':"{$id}",'sid':sid,},function(res){
            	console.log(res);
                history.go(0);
            },'json')
        }
    })
    $(".ss").click(function(){
        var num = $("#jtnum").val();
        if(num.length>1){
            $.post("{:url('upss')}",{username:num},function(res){
                console.log(res);
                $("#ss").find('input').val(res.list.name);
                $("#ss").find('input').attr('sid',res.list.id);
            },'json')
        }else{
            $("#ss").find('input').val('');
        }
    })
	$(".addbus").click(function(){
		$.post("{:url('busadd')}",{},function(res){
			console.log(res);
		},'json')
	})
    $(".dtqx").click(function(){
        var id = $(this).attr('sid');
        $(this).closest(".imgdtdiv").hide();
        $.post("{:url('atlas/delete')}",{id},function(date){console.log(date)},'json');
    })

    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
    $(".listbu").click(function(){
        history.back(-1);
    })
</script>
{/block}